package com.econ.powercloud.ems.common.enums;

/**
 * 电价模型状态枚举
 */
public enum ModelStatus implements EnumMethod {

    ALL(0,"全部"),
    EFFECTIVE(1,"有效"),
    INVALID(2,"失效"),
    NOT_ENABLE(3,"未启动"),
    ;

    private Integer code;
    private String desc;

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    ModelStatus(int code, String desc){
        this.code=code;
        this.desc=desc;
    }

    public static String getCodeFromCode(int code){
        for(ModelStatus type: ModelStatus.values()){
            if(type.getCode() == code){
                return type.getDesc();
            }
        }
        return null;
    }

}
